import "./App.css";
import React from "react";

function App() {
  function FnHello() {
    return <div>hello 函数组件</div>;
  }
  class ClassHello extends React.Component {
    constructor(props) {
      super(props);
    }
    render() {
      return <div>hello class组件</div>;
    }
  }

  function ReactHello() {
    return React.createElement(
      "div",
      [],
      "hello 不用jsx，用react.createElement"
    );
  }
  console.log(FnHello, "调用方法");
  console.log(<FnHello></FnHello>, "组件用法");
  let num = 1;
  let arr = ["a", "b", "c"];
  const com1 = <FnHello></FnHello>;
  const arr2 = [com1, "880", "99"];
  // const obj = {
  //   a: 1,
  // };

  return (
    <div className="App">
      {"I am string"}
      {num + 1}
      {arr}
      {arr2}
      {"****"}
      {/* {null} */}
      {FnHello}
      {/* {obj} */ com1}

      <FnHello></FnHello>
      <ClassHello></ClassHello>
      <ReactHello></ReactHello>
    </div>
  );
}

export default App;
